package cn.stronglink.asset.module.assetmanage.borrowreturn.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.plugins.pagination.Pagination;

import cn.stronglink.asset.model.BorrowReturn;
import cn.stronglink.asset.model.BorrowReturnDetail;
import cn.stronglink.asset.module.assetmanage.itasset.vo.ItAssetVo;
import cn.stronglink.asset.module.assetmanage.transfer.vo.OriginalAssetInfo;


public interface BorrowReturnMapper {

	List<BorrowReturn> queryBorrowReturnList(Pagination page,@Param("params") Map<String, Object> params);

	List<BorrowReturnDetail> qryBorrowReturnDetailByBorrowReturnId(@Param("borrowReturnId")Long borrowReturnId);

	void delBorrowReturnDetailByBorrowReturnId(@Param("borrowReturnId")Long borrowReturnId);
	
	void remove(@Param("id")Long id);

	void insertBorrowReturn(BorrowReturn borrowReturn);

	OriginalAssetInfo getAsset(@Param("assetId")Long assetId);

	void insertBorrowReturnDetail(BorrowReturnDetail detail);
	
	BorrowReturn qryById(@Param("id")Long id);

	List<BorrowReturnDetail> queryBorrowReturnDetailList(Pagination page, @Param("params")Map<String, Object> params);

	BorrowReturnDetail queryDetailById(@Param("id")Long id);

	void update(BorrowReturn borrowReturn);

	void updateBorrowReturnToBorrow(@Param("id") Long id);

	void updateBorrowReturnDetailToBorrowByBorrowReturnId(BorrowReturnDetail detail);

	void updateAssetIsBorrow(List<BorrowReturnDetail> detailList);

	void updateAssetExtUsingTarget(BorrowReturnDetail borrowReturnDetail);
	
	void updateBorrowReturnToReturn(@Param("id") Long id);

	void updateBorrowReturnDetailToReturnByBorrowReturnId(BorrowReturnDetail detail);

	void updateAssetIsNotBorrow(List<BorrowReturnDetail> detailList);

	void updateAssetExtUsingOriginal(BorrowReturnDetail borrowReturnDetail);
	
	public List<ItAssetVo> querAssetListByParam(Pagination page,@Param("params") Map<String, Object> params);

	Integer queryNotReturnNum(@Param("borrowReturnId")Long borrowReturnId);

	List<BorrowReturnDetail> qryBorrowList(@Param("borrowReturnId")Long borrowReturnId);

}
